﻿<UserControls:ScrumUserControl x:Class="ScrumTable.UI.View.WinTouch.UserControls.View.StackedDailyScrumStoryBoard"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Converter="clr-namespace:ScrumTable.UI.View.Converter;assembly=ScrumTable.UI.View"
    xmlns:s="clr-namespace:Microsoft.Surface.Presentation;assembly=Microsoft.Surface.Presentation"
    xmlns:ViewModel="clr-namespace:ScrumTable.UI.ViewModel;assembly=ScrumTable.UI.ViewModel"
    xmlns:Controls="clr-namespace:Microsoft.Surface.Presentation.Controls;assembly=Microsoft.Surface.Presentation"
    xmlns:Localization="clr-namespace:ScrumTable.UI.View.Localization;assembly=ScrumTable.UI.View" xmlns:Collections="clr-namespace:System.Collections;assembly=mscorlib" xmlns:System="clr-namespace:System;assembly=mscorlib"  xmlns:CustomControl="clr-namespace:ScrumTable.UI.View.CustomControl;assembly=ScrumTable.UI.View" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:Tool="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls.Tool" xmlns:Tools="clr-namespace:ScrumTable.UI.ViewModel.Tools;assembly=ScrumTable.UI.ViewModel" xmlns:Util="clr-namespace:ScrumTable.UI.View.WinTouch.Util" Background="White">
    <Grid Name="RootGrid"> 
        <Grid.Resources>            
            <Converter:GridHiddenWidthConverter x:Key="IsGridColumVisibleConverter"/>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" Name="BugRow"/>
            <RowDefinition Height="1*" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Name="FirstColumn" Width="300"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="{Binding ConfigManager.Config.IsHiddenChart, Converter={StaticResource IsGridColumVisibleConverter}, ConverterParameter='0.4'}" />
        </Grid.ColumnDefinitions>


        <Controls:SurfaceCheckBox  x:Name="CheckBox" IsChecked="true"  Click="OnCheckBoxClick"  Grid.Column="0" Grid.Row="0" Margin="10,0,40,0" VerticalAlignment="Center" VerticalContentAlignment="Center" Padding="0">
            <Label VerticalAlignment="Center" Padding="0" Margin="5,4,0,0" Content="{Localization:Translate Uid=Daily_Stacked_ExpandAll, Default=[ExpandAll]}"/>
        </Controls:SurfaceCheckBox>        
        <UserControls:AddButton ButtonType="Story"  Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center" Click="OnAddStoryClick" Width="25" Height="25" Margin="0,-1,0,0"></UserControls:AddButton>
        
        <Grid Name="TitleGrid" Grid.Row="0"  Grid.Column="1"  HorizontalAlignment="Stretch" VerticalAlignment="Top"/>

        <UserControls:SurfaceDragDropListBox   MultipleColumnsRows="False" ScrollViewer.VerticalScrollBarVisibility="Hidden"  ScrollViewer.HorizontalScrollBarVisibility="Hidden"  ScrollViewer.CanContentScroll="False"  x:Name="BugList"
                            Grid.Row="1" Padding="0" Grid.ColumnSpan="2" 
                            IsItemSelectable="False" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type UserControls:ScrumUserControl }}}"
                            AllowDrop="False" AddOnDrop="False"
                            VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="0"  SelectionChanged="OnSelectionChangedHeader">
            <!--DUMMY-->
            <Button/>

            <UserControls:SurfaceDragDropListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <CustomControl:StackPanelAnimated IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </UserControls:SurfaceDragDropListBox.ItemsPanel>
            <UserControls:SurfaceDragDropListBox.ChildTypeAsDragDropSource>                                
                <x:Array Type="{x:Type System:Type}">
                    <x:Type  TypeName="UserControls:BugControl"></x:Type>
                </x:Array>
            </UserControls:SurfaceDragDropListBox.ChildTypeAsDragDropSource>

            <UserControls:SurfaceDragDropListBox.ItemTemplate>
                <DataTemplate>
                    <Grid HorizontalAlignment="Stretch" Margin="-10,0,-4,0">
                        <UserControls:BoardBugControl Padding="0" Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type UserControls:SurfaceDragDropListBox }}}" />
                    </Grid>
                </DataTemplate>
            </UserControls:SurfaceDragDropListBox.ItemTemplate>

        </UserControls:SurfaceDragDropListBox>
        

        <UserControls:SurfaceDragDropListBox   MultipleColumnsRows="False" ScrollViewer.VerticalScrollBarVisibility="Hidden"  ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
            Grid.Column="0" Grid.Row="2"  Grid.RowSpan="2" Grid.ColumnSpan="2"
            x:Name="StoriesList" IsItemSelectable="False"
            AllowDrop="False" AddOnDrop="False" 
            VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch"  SelectionChanged="OnSelectionChanged"          
            ItemsSource="{Binding UserStoriesAsViewModel}">

            <UserControls:SurfaceDragDropListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <CustomControl:StackPanelAnimated IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </UserControls:SurfaceDragDropListBox.ItemsPanel>

            <UserControls:SurfaceDragDropListBox.ChildTypeAsDragDropSource>

                <x:Array Type="{x:Type System:Type}">
                    <x:Type  TypeName="UserControls:TaskControl"></x:Type>
                    <x:Type  TypeName="UserControls:UserStoryControl"></x:Type>
                    <x:Type  TypeName="UserControls:BugControl"></x:Type>
                </x:Array>

            </UserControls:SurfaceDragDropListBox.ChildTypeAsDragDropSource>

            <UserControls:SurfaceDragDropListBox.ItemTemplate>
                <DataTemplate>
                    <Grid HorizontalAlignment="Stretch" Margin="-10,0,-4,0">
                        <UserControls:BoardUserStoryControl  Padding="0" Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type UserControls:SurfaceDragDropListBox }}}" BoardUserStory="{Binding}"></UserControls:BoardUserStoryControl>
                    </Grid>
                </DataTemplate>
            </UserControls:SurfaceDragDropListBox.ItemTemplate>

        </UserControls:SurfaceDragDropListBox>

        <!-- Burndown Chart -->
        <Grid Grid.Column="3" Grid.Row="0" Grid.RowSpan="5">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.5*"></RowDefinition>
                <RowDefinition Height="0.5*"></RowDefinition>
            </Grid.RowDefinitions>
            <Tool:ReportControl  Grid.Row="0" x:Name="Report1">
                <UserControls:ScrumUserControl.BuildUpViewModelSource>
                    <Tools:ViewModelReportControl Name="Daily_Report_1"></Tools:ViewModelReportControl>
                </UserControls:ScrumUserControl.BuildUpViewModelSource>
            </Tool:ReportControl>

            <Tool:ReportControl   Grid.Row="1" x:Name="Report2">
                <UserControls:ScrumUserControl.BuildUpViewModelSource>
                    <Tools:ViewModelReportControl Name="Daily_Report_2"></Tools:ViewModelReportControl>
                </UserControls:ScrumUserControl.BuildUpViewModelSource>                
            </Tool:ReportControl>

        </Grid>
    </Grid>
</UserControls:ScrumUserControl>
